// pages/goodList/index.ts

import ur from "../../utils/extendApi"

Page({

  /**
   * 页面的初始数据
   */
  data: {
    filterlist:[{
      name:'综合',
      code:'zonghe'
    },{
      name:'销量',
      code:'xiaoliang', 
    },{
      name:'价格',
      code:'jiage'
    },{
      name:'折扣',
      code:'zhekou'
    }],
    currentmenulist:[],
    currentmenuitem:{},
    activeTopIndex:0,
    activeFilterIndex:0,
    list: [{
      name: '苏苏1',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试',
      url: 'https://img0.baidu.com/it/u=2407725302,184767986&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
      avatar: 'https://img0.baidu.com/it/u=2407725302,184767986&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
    },
    {
      name: '苏苏2',
      num: '1',
      title: '测试数据测试测试测试测测',
      url: 'https://img2.baidu.com/it/u=2215607579,3701639477&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/7.png'
    },
    {
      name: '苏苏3',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img2.baidu.com/it/u=2351825636,240916586&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1067',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/6.png'
    },
    {
      name: '苏苏4',
      num: '1',
      title: '测试数据测试测试测试测测',
      url: 'https://img1.baidu.com/it/u=3626811047,3601764583&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=645',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/3.png'
    },
    {
      name: '苏苏5',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img1.baidu.com/it/u=3388053200,1936200644&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/1.png'
    },
    {
      name: '苏苏6',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img0.baidu.com/it/u=1628351344,737919542&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/2.png'
    },{
      name: '苏苏1',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试',
      url: 'https://img0.baidu.com/it/u=2407725302,184767986&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
      avatar: 'https://img0.baidu.com/it/u=2407725302,184767986&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
    },
    {
      name: '苏苏2',
      num: '1',
      title: '测试数据测试测试测试测测',
      url: 'https://img2.baidu.com/it/u=2215607579,3701639477&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/7.png'
    },
    {
      name: '苏苏3',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img2.baidu.com/it/u=2351825636,240916586&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1067',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/6.png'
    },
    {
      name: '苏苏4',
      num: '1',
      title: '测试数据测试测试测试测测',
      url: 'https://img1.baidu.com/it/u=3626811047,3601764583&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=645',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/3.png'
    },
    {
      name: '苏苏5',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img1.baidu.com/it/u=3388053200,1936200644&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/1.png'
    },
    {
      name: '苏苏6',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img0.baidu.com/it/u=1628351344,737919542&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/2.png'
    },{
      name: '苏苏1',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试',
      url: 'https://img0.baidu.com/it/u=2407725302,184767986&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
      avatar: 'https://img0.baidu.com/it/u=2407725302,184767986&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
    },
    {
      name: '苏苏2',
      num: '1',
      title: '测试数据测试测试测试测测',
      url: 'https://img2.baidu.com/it/u=2215607579,3701639477&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/7.png'
    },
    {
      name: '苏苏3',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img2.baidu.com/it/u=2351825636,240916586&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1067',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/6.png'
    },
    {
      name: '苏苏4',
      num: '1',
      title: '测试数据测试测试测试测测',
      url: 'https://img1.baidu.com/it/u=3626811047,3601764583&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=645',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/3.png'
    },
    {
      name: '苏苏5',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img1.baidu.com/it/u=3388053200,1936200644&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/1.png'
    },
    {
      name: '苏苏6',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img0.baidu.com/it/u=1628351344,737919542&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/2.png'
    },{
      name: '苏苏1',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试',
      url: 'https://img0.baidu.com/it/u=2407725302,184767986&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
      avatar: 'https://img0.baidu.com/it/u=2407725302,184767986&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
    },
    {
      name: '苏苏2',
      num: '1',
      title: '测试数据测试测试测试测测',
      url: 'https://img2.baidu.com/it/u=2215607579,3701639477&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/7.png'
    },
    {
      name: '苏苏3',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img2.baidu.com/it/u=2351825636,240916586&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1067',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/6.png'
    },
    {
      name: '苏苏4',
      num: '1',
      title: '测试数据测试测试测试测测',
      url: 'https://img1.baidu.com/it/u=3626811047,3601764583&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=645',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/3.png'
    },
    {
      name: '苏苏5',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img1.baidu.com/it/u=3388053200,1936200644&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/1.png'
    },
    {
      name: '苏苏6',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img0.baidu.com/it/u=1628351344,737919542&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/2.png'
    },{
      name: '苏苏1',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试',
      url: 'https://img0.baidu.com/it/u=2407725302,184767986&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
      avatar: 'https://img0.baidu.com/it/u=2407725302,184767986&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
    },
    {
      name: '苏苏2',
      num: '1',
      title: '测试数据测试测试测试测测',
      url: 'https://img2.baidu.com/it/u=2215607579,3701639477&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/7.png'
    },
    {
      name: '苏苏3',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img2.baidu.com/it/u=2351825636,240916586&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1067',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/6.png'
    },
    {
      name: '苏苏4',
      num: '1',
      title: '测试数据测试测试测试测测',
      url: 'https://img1.baidu.com/it/u=3626811047,3601764583&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=645',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/3.png'
    },
    {
      name: '苏苏5',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img1.baidu.com/it/u=3388053200,1936200644&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/1.png'
    },
    {
      name: '苏苏6',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img0.baidu.com/it/u=1628351344,737919542&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/2.png'
    },{
      name: '苏苏1',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试',
      url: 'https://img0.baidu.com/it/u=2407725302,184767986&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
      avatar: 'https://img0.baidu.com/it/u=2407725302,184767986&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
    },
    {
      name: '苏苏2',
      num: '1',
      title: '测试数据测试测试测试测测',
      url: 'https://img2.baidu.com/it/u=2215607579,3701639477&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/7.png'
    },
    {
      name: '苏苏3',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img2.baidu.com/it/u=2351825636,240916586&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1067',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/6.png'
    },
    {
      name: '苏苏4',
      num: '1',
      title: '测试数据测试测试测试测测',
      url: 'https://img1.baidu.com/it/u=3626811047,3601764583&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=645',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/3.png'
    },
    {
      name: '苏苏5',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img1.baidu.com/it/u=3388053200,1936200644&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/1.png'
    },
    {
      name: '苏苏6',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img0.baidu.com/it/u=1628351344,737919542&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/2.png'
    },{
      name: '苏苏1',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试',
      url: 'https://img0.baidu.com/it/u=2407725302,184767986&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
      avatar: 'https://img0.baidu.com/it/u=2407725302,184767986&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
    },
    {
      name: '苏苏2',
      num: '1',
      title: '测试数据测试测试测试测测',
      url: 'https://img2.baidu.com/it/u=2215607579,3701639477&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/7.png'
    },
    {
      name: '苏苏3',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img2.baidu.com/it/u=2351825636,240916586&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1067',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/6.png'
    },
    {
      name: '苏苏4',
      num: '1',
      title: '测试数据测试测试测试测测',
      url: 'https://img1.baidu.com/it/u=3626811047,3601764583&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=645',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/3.png'
    },
    {
      name: '苏苏5',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img1.baidu.com/it/u=3388053200,1936200644&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/1.png'
    },
    {
      name: '苏苏6',
      num: '1',
      title: '测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测测试数据测试测试测试测',
      url: 'https://img0.baidu.com/it/u=1628351344,737919542&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
      avatar: 'https://gitee.com/susuhhhhhh/su-sus-picture/raw/master/%E5%A5%BD%E7%9C%8B%E5%9B%BE%E7%89%87/2.png'
    },
    ]

  },

  onActiveTop(e: any) {
    this.setData({
      activeTopIndex: e.currentTarget.dataset['index'],
      // activeLeftIndex: 0,
      activeFilterIndex:0,
      toView: 'hello'
    })
  },

  onActiveFilter(e:any){
    this.setData({
      activeFilterIndex:e.currentTarget.dataset['index']
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad() {
    this.setData({
      currentmenulist:ur.getStorageApi('currentmenulist'),
      currentmenuitem:ur.getStorageApi('currentmenuitem'),
      activeTopIndex:ur.getStorageApi('currentmenulist').findIndex((item:any)=>ur.getStorageApi('currentmenuitem').code===item.code)
    })
    
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})